<!--#include file="lib/utf-8.asp"-->
<!--#include file="lib/connopen.asp"-->
<!--#include file="lib/asp-json-lib.asp"-->

<%
'数据要求格式：
'[{"empe_id":1,"empe_name":"王三"},{"empe_id":2,"empe_name":"李四"}]
Response.ContentType = "application/json"
dim json,rs,sql
set json=jsArray()
' set json(Null) = jsObject()
dept_id=request("dept_id")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select empe_id,empe_name from empe where empe_dept="&dept_id&" order by empe_index"
rs.Open sql,conn,1,1
do while not rs.eof
  set json(Null) = jsObject()
  json(Null)("empe_id")=rs("empe_id")
  json(Null)("empe_name")=rs("empe_name")
  rs.movenext
loop
rs.close
set rs=nothing
json.Flush
%>
<!--#include file="lib/connclose.asp"-->